<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="ComponenteFormulaEditDlg" widgetVar="ComponenteFormulaEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditComponenteFormulaTitle}">
            <h:form id="ComponenteFormulaEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{componenteFormulaController.selected != null}">
                        <p:outputLabel value="#{bundle.EditComponenteFormulaLabel_idComponenteFormula}" for="idComponenteFormula" />
                        <p:inputText id="idComponenteFormula" value="#{componenteFormulaController.selected.idComponenteFormula}" title="#{bundle.EditComponenteFormulaTitle_idComponenteFormula}" required="true" requiredMessage="#{bundle.EditComponenteFormulaRequiredMessage_idComponenteFormula}"/>
                        <p:outputLabel value="#{bundle.EditComponenteFormulaLabel_formula}" for="formula" />
                        <p:inputText id="formula" value="#{componenteFormulaController.selected.formula}" title="#{bundle.EditComponenteFormulaTitle_formula}" />
                        <p:outputLabel value="#{bundle.EditComponenteFormulaLabel_unidad}" for="unidad" />
                        <p:inputText id="unidad" value="#{componenteFormulaController.selected.unidad}" title="#{bundle.EditComponenteFormulaTitle_unidad}" />
                        <p:outputLabel value="#{bundle.EditComponenteFormulaLabel_idIndicador}" for="idIndicador" />
                        <p:selectOneMenu id="idIndicador" value="#{componenteFormulaController.selected.idIndicador}" required="true" requiredMessage="#{bundle.EditComponenteFormulaRequiredMessage_idIndicador}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{indicadorController.itemsAvailableSelectOne}"
                                           var="idIndicadorItem"
                                           itemValue="#{idIndicadorItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{componenteFormulaController.update}" value="#{bundle.Save}" update="display,:ComponenteFormulaListForm:datalist,:growl" oncomplete="handleSubmit(args, 'ComponenteFormulaEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="ComponenteFormulaEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
